<extend name="template/base_index" />


<block name="area_header">
    <link type="text/css" rel="stylesheet" href="__CDN__/select2/4.0.0/css/select2.min.css" />
    <link type="text/css" rel="stylesheet" href="__CDN__/select2/4.0.0/css/cosmo-skin.css" />
</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}
            <div class="h4">实名认证审核</div>

            <div class="filter-controls">
                <form class="form-inline searchForm" method="post" action="{:U('Admin/Withdraw/verify')}">
                    <div class="form-group">
                        <div class="input-group">
                            <div class="input-group-addon"><i class="fa fa-user"></i>用户</div>
                            <select style="width:220px;padding: 10px 15px;font-size: 15px;line-height: 1.42857143;" id="user_select2" name="uid" class="form-control">
                                    <option></option>
                            </select>
                            &nbsp;
                            <button class="btn btn-sm btn-primary" type="submit">查询</button>
                        </div>
                    </div>
                    <div class="form-group">
                      </div>
                </form>
            </div>

            <div class="table-responsive">
                <table class="table table-bordered table-striped table-condensed table-hover table-condensed">
                    <thead>
                    	<th>
                            用户ID
                        </th>
                        <th>
                            用户昵称
                        </th>
                       
                       <th>
                          姓名
                        </th>
                        <th>
                            身份证号码
                        </th>
                        <th>
                             操作
                        </th>

                    </thead>
                    <tbody>
                    <volist name="member" id="vo">
                    	<volist name="user" id="v">
                    		<if condition="$vo['uid'] eq $v['uid']">
	                        <tr>
	                        	
	                            <td>
	                                {$vo.uid}
	                            </td>
	                            
	                            <td>
	                                {$v.nickname}
	                            </td>
	                            <td>
	                                {$v.realname}
	                            </td>
	                            <td>
	                                {$v.idnumber}
	                            </td>
	                            <td>
	                                <a href="{:U('Admin/Member/pass',array('id'=>$vo['uid']))}" class="btn btn-primary btn-sm ajax-get"><i class="fa fa-check"></i>通过</a>
	                                <a class="btn btn-sm btn-danger" href="{:U('Admin/Member/fail',array('id'=>$vo['uid']))}"><i class="fa fa-times"></i>驳回</a>
	                            </td>
	                        </tr>
	                        </if>
                        </volist>
                    </volist>
                    </tbody>
                </table>
                <div>{$show}</div>
            </div>

        </div>
        <!-- END admin-main-content -->
    </div>
    <!-- END admin-main-->
</block>

<block name="area_footer">
    <script src="__CDN__/select2/4.0.0/js/select2.min.js"></script>
    <script src="__CDN__/select2/4.0.0/js/i18n/zh-CN.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#user_select2").select2({
                placeholder: "输入用户id或昵称查询"	,
                language: "zh-CN",
                ajax: {
                    url: "{:U('Admin/Wxuser/select')}",
                    dataType: 'json',
                    delay: 250,
                    data: function (params) {
                        var queryParameters = {
                            q: params.term
                        }
                        return queryParameters;

                    },
                    processResults: function (data, page) {
                        if(!data.info){
                            data.info = new Array();
                            data.info['nodata']="无相关数据";
                        }
                        // parse the results into the format expected by Select2.
                        // since we are using custom formatting functions we do not need to
                        // alter the remote JSON data
                        return {
                            results: data.info
                        };
                    },
                    cache: true
                },
                minimumInputLength: 0,
                templateSelection: function (repo) {
                    return repo.nickname || repo.text;
                },
                templateResult: function (repo) {

                    if (repo.loading) return repo.text;
                    if(repo.nodata) return repo.nodata;
//    				var markup = '<div>'+repo.nickname+'</div>';
                    var markup = '<div><img src="'+repo.avatar+'" style="width:30px;height:30px;"/>[id:'+repo.id+'] '+repo.nickname+'</div>';
                    return markup;
                },
            });
        });
    </script>
</block>